//
//  WJYViewController.m
//  newTestGit
//
//  Created by fangjs on 16/3/18.
//  Copyright © 2016年 Hongshi. All rights reserved.
//

/*    本界面的功能是:点击 cell 的时候结束编辑,收回键盘    */

#import "WJYViewController.h"
#import "WJYTableView.h"
@interface WJYViewController () <UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *MyTableView;
@property (nonatomic , strong) UITextField *WJYText;

@end

@implementation WJYViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

#pragma mark - UItable view dataSource

- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellID = @"cellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    
    cell.textLabel.text = @"ceshi";
    if (indexPath.row == 4) {
        cell.textLabel.text = nil;
        self.WJYText = [[UITextField alloc] initWithFrame:CGRectMake(100, 5, 200, 30)];
        self.WJYText.backgroundColor = [UIColor orangeColor];
        [cell addSubview:self.WJYText];
    }
    
    return cell;
    
}

#pragma  mark - UItable view delegate
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    NSLog(@"%ld",(long)indexPath.row);
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
